import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;

public class Solution1403 {
    public List<Integer> minSubsequence(int[] nums) {
        Arrays.sort(nums);
        List<Integer> list=new ArrayList<>();
        int sum=Arrays.stream(nums).sum();
        int now=0;
        for (int i=nums.length-1;i>=0;i--){
            now+=nums[i];
            list.add(nums[i]);
            if (now*2>sum){
                return list;
            }
        }
        return null;
    }

    public static void main(String[] args) {
        System.out.println(new Solution1403().minSubsequence(new int[]{4,3,10,9,8}));
    }
}
